﻿import request from '/@/utils/request';
enum Api {
	AddSysDbLink = '/api/sysDbLink/add',
	DeleteSysDbLink = '/api/sysDbLink/delete',
	UpdateSysDbLink = '/api/sysDbLink/update',
	PageSysDbLink = '/api/sysDbLink/page',
	DetailSysDbLink = '/api/sysDbLink/detail',
	TestDbConnection = '/api/sysDbLink/test',
	SelectorSysDbLink = '/api/sysDbLink/selector',
}

// 增加数据连接
export const addSysDbLink = (params?: any) =>
	request({
		url: Api.AddSysDbLink,
		method: 'post',
		data: params,
	});

// 删除数据连接
export const deleteSysDbLink = (params?: any) =>
	request({
		url: Api.DeleteSysDbLink,
		method: 'post',
		data: params,
	});

// 编辑数据连接
export const updateSysDbLink = (params?: any) =>
	request({
		url: Api.UpdateSysDbLink,
		method: 'post',
		data: params,
	});

// 分页查询数据连接
export const pageSysDbLink = (params?: any) =>
	request({
		url: Api.PageSysDbLink,
		method: 'post',
		data: params,
	});

// 详情数据连接
export const detailSysDbLink = (id: any) =>
	request({
		url: Api.DetailSysDbLink,
		method: 'get',
		data: { id },
	});

// 详情数据连接
export const testDbConnection = (params?: any) =>
	request({
		url: Api.TestDbConnection,
		method: 'post',
		data: params,
	});

// 下拉框列表
export const selectorSysDbLink = (type: any) =>
	request({
		url: Api.SelectorSysDbLink,
		method: 'get',
		data: { type },
	});
